<?php
namespace My\Model;


use Utuo\UtuoModel;

class DeliveryModel extends UtuoModel {
	
	public static $METHOD = array(
		'1' => array(
			'name' => '快递',
			'tag' => 'express',
			'value' => 1,
		),
		'2' => array(
			'name' => 'EMS',
			'tag' => 'ems',
			'value' => 2,
		),
		'3' => array(
			'name' => '平邮',
			'tag' => 'post',
			'value' => 3,
		),
	);
	
	/**
	 * 获得配送方式id
	 * @param unknown $tag
	 * @return multitype:string number
	 */
	public static function getTypeId( $tag ) {
		foreach( self::$METHOD as $k => $v ) {
			if( $v['tag'] == $tag) {
				return $k;
			}
		}
		return 0;
	}
	
}